
package com.zsrt.jmj.company.controller;

import java.util.HashMap;
import java.util.Map;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zsrt.jmj.company.entity.CompanyEntity;
import com.zsrt.jmj.company.service.CompanyService;

@Controller
@RequestMapping("/company")
public class CompanyController {

	@Autowired
	private CompanyService service;
	
	@ResponseBody
	@RequestMapping("/add")
	public Map<String, Object> add(CompanyEntity entity) {
		
		Map<String, Object> map = new HashMap<>();
		service.add(entity, map );
		
		return map;
	}
	@ResponseBody
	@RequestMapping("/findAllCompanys")
	public Map<String, Object> findAllCompanys() {
		
		Map<String, Object> map = new HashMap<>();
		service.findAllCompanys( map );
		
		return map;
	}
	@ResponseBody
	@RequestMapping("/updateById")
	public Map<String, Object> updateById(CompanyEntity entity) {
		
		Map<String, Object> map = new HashMap<>();
		service.updateById( entity,map );
		
		return map;
	}
	@ResponseBody
	@RequestMapping("/findCompanyById")
	public Map<String, Object> findCompanyById(int id) {
		
		Map<String, Object> map = new HashMap<>();
		service.findCompanyById( id,map );
		
		return map;
	}
	@ResponseBody
	@RequestMapping("/deleteByIds")
	public Map<String, Object> deleteByIds(String ids) {
		
		Map<String, Object> map = new HashMap<>();
		service.deleteByIds( ids,map );
		
		return map;
	}
}
